package com.uphone.edwards.util;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedUtils {
    //进入APP，首次存语言为英语，type为2
    public static void putShareLanguage(String type , Context mContext){
        SharedPreferences share = mContext.getSharedPreferences("languageCode" , 0);
        SharedPreferences.Editor editor = share.edit();
        editor.putString("languageCode" , type);
        editor.apply();
    }

    //获取语言类型，如为空，则直接默认填入2。
    public static String getShareLanguage(Context mContext){
        SharedPreferences shared = mContext.getSharedPreferences("languageCode" , 0);
        return shared.getString("languageCode" , "");
    }
}
